package org.imraniqbal.engine;

public abstract class Item extends Mappable {

	/**
	 * Creates an Item at position x,y
	 * @param x X coordinate of Item
	 * @param y Y coordinate of Item
	 * @author imran
	 */
	public Item(int x, int y) {
		super(x, y);
	}
	/**
	 * Abstract method which forces items to have some effect
	 * @param obj an object the item affects
	 * @author imran
	 */
	public abstract void action(Object obj,Map map);
	
	/**
	 * @author imran
	 */
	@Override
	public boolean equals(Object obj){
		if(obj instanceof Item){
			return(((Mappable)obj).getX() == this.getX() && this.getY() == ((Mappable)obj).getY());
		}
		return false;
	}
}
